import { request } from "@/utils/axios"

/**
 * 获取机构管理列表
 */
export function findOrganizationListPage(params) {
    return request(
        {
            url: `/agent/findOrganizationListPage`,
            method: "GET",
            data: {},
            params
        }
    );
}

/**
 * 通过userId 获取机构信息
 */
export function getInformationByUserId(userId) {
    return request(
        {
            url: `/information/getInformationByUserId?userId=${userId}`,
            method: "GET",
            data: {}
        }
    );
}

/**
 * 获取机构信息中的人员管理
 */
export function getAllPersonnel(params) {
    return request(
        {
            url: `/organizing/getAllPersonnel`,
            method: "GET",
            data: {},
            params
        }
    );
}

/**
 * 审核机构
 */
export function auditOrganization(params) {
    return request(
        {
            url: `/agent/auditOrganization`,
            method: "PUT",
            data: {},
            params
        }
    );
}

/**
 * 批量删除机构
 */
export function deleteOrganizations(userIds) {
    return request(
        {
            url: `/agent/deleteOrganizations?userIds=${userIds}`,
            method: "DELETE",
            data: {}
        }
    );
}

/**
 * 获取参赛审核列表
 */
export function getCompetitionListPage(params) {
    return request(
        {
            url: `/agent/getCompetitionListPage`,
            method: "GET",
            data: {},
            params
        }
    );
}

/**
 * 修改参赛审核状态
 */
export function auditCompetitionStudent(params) {
    return request(
        {
            url: `/agent/auditCompetitionStudent`,
            method: "PUT",
            data: {},
            params
        }
    );
}


/**
 * 撤销报名
 */
export function withdrawalRegistration(params) {
    return request(
        {
            url: `/agent/withdrawalRegistration`,
            method: "PUT",
            data: {},
            params
        }
    );
}

/**
 * 获取统计信息
 */
export function getStatistics(userId) {
    return request(
        {
            url: `/agent/getStatistics?userId=${userId}`,
            method: "GET",
            data: {}
        }
    );
}

/**
 * 上传图片接口确认
 */
export function updateIdImage(data) {
    return request(
        {
            url: `/agent/updateIdImage`,
            method: "PUT",
            data: data
        }
    );
}

/**
 * 获取上传图片接口确认
 */
export function getIdImage() {
    return request(
        {
            url: `/information/getIdImage`,
            method: "GET",
            data: {}
        }
    );
}